# (1) 累加1~100
# sum = 0
# num = 1
# while num <= 100:
#     sum += num
#     num += 1
# print(sum)
# (2) 计算整数n的阶乘
# num = int(input('请输入整数:>'))
# res = 1
# while num:
#     res *= num
#     num -= 1
# print(f'阶乘为{res}')
# (3) 计算!n+!(n-1)+...+!1
num = int(input('请输入整数:>'))
total = 0
while num:
    tmp = num
    res = 1
    while tmp:
        res *= tmp
        tmp -= 1
    total += res
    num -= 1
print(f'结果为{total}')
